import myaxios from '../Myaxios'
import BASEURL from '../BaseUrl.js'
const { BMDURL } = BASEURL
const orderApi = {
    /**
     * 查询所有订单
     */
    queryAll(params) {
        // let params = { page: 1, pagesize: 3 }
        return myaxios.get(BMDURL + '/indent/list', params)
    },
    /**
     * 通过单号查询订单
     * @param {Object} parems 单号
     * @returns 
     */
    queryByOdd(params) {
        return myaxios.get(BMDURL + '/indent/odd', params)
    },
    /**
     * 通过id查询订单
     * @param {Object} params 订单id
     * @returns 
     */
    queryById(params) {
        return myaxios.get(BMDURL + '/indent/id', params)
    },
    /**
   * 通过用户id查询订单
   * @param {Object} params 用户id
   * @returns 
   */
    queryByUid(params) {
        return myaxios.get(BMDURL + '/indent/uid', params)
    },
    /**
* 通过门店aid查询订单
* @param {Object} params 
* @returns 
*/
    queryByAid(params) {
        console.log(params, '@#@')
        return myaxios.get(BMDURL + '/indent/aid', params)
    },
    /**
  * 通过发货状态查询订单
  * @param {Object} params 
  * @returns 
  */
    queryByDelivery(params) {
        return myaxios.get(BMDURL + '/indent/delivery', params)
    },
    /**
   * 通过购物车状态查询订单
   * @param {Object} params 
   * @returns 
   */
    queryByChecked(params) {
        return myaxios.get(BMDURL + '/indent/checked', params)
    },
    /**
   * 通过付款状态查询订单
   * @param {Object} params 
   * @returns 
   */
    queryByPayed(params) {
        return myaxios.get(BMDURL + '/indent/payed', params)
    },
    /**
   * 通过收货状态查询订单
   * @param {Object} params 
   * @returns 
   */
    queryByReceived(params) {
        return myaxios.get(BMDURL + '/indent/received', params)
    },
    /**
  * 通过是否退款查询订单
  * @param {Object} params  {quit：默认是0没有退货 ,1是退货退款，2是换货不退款}
  * @returns 
  */
    queryByQuit(params) {
        return myaxios.get(BMDURL + '/indent/quit', params)
    },
    /**
     * 通过id删除订单
     * @param {Object} params {id:2}
     * @returns 
     */
    delete(params) {
        return myaxios.post(BMDURL + '/indent/delete', params)
    },
    /**
     * 通过id修改订单信息
     * @param {Object} params 
     * @returns 
     */
    update(params) {
        return myaxios.post(BMDURL + '/indent/update', params)
    },
    /**
     * 新增订单
     * @param {Object} params 
     * @returns 
     */
    add(params) {
        return myaxios.post(BMDURL + '/indent/add', params)
    }

}
export default orderApi